clear all
clc
set(0,'DefaultFigureWindowStyle','docked')

% yyyymm    nom_slope_10_1  
dat1 = xlsread('plot_nominal.xls');

yyyymm1 = dat1(:,1);
mm1 = mod(yyyymm1,100);
yyyy1 = (yyyymm1 - mm1)/100;

datenums1 = datenum(yyyy1,mm1,eomday(yyyy1,mm1));

nom_slope_10_1 = dat1(:,2);

% yyyymm	tips_slope_10_1	tips_liqadj_slope_10_1
dat2 = xlsread('plot_tips.xls');

yyyymm2 = dat2(:,1);
mm2 = mod(yyyymm2,100);
yyyy2 = (yyyymm2 - mm2)/100;

datenums2 = datenum(yyyy2,mm2,eomday(yyyy2,mm2));

tips_slope_10_1 = dat2(:,2);
tips_liqadj_slope_10_1 = dat2(:,3);

%% nice plot

TickFontSize = 14;
FontSize = 20;

LineWidth = 2;

figure

subplot(1,2,1)
hold on
plot(datenums1, nom_slope_10_1, '-b', 'LineWidth', LineWidth)
datetick x
ax = gca;
set(ax,'xlim',[datenum(1970,1,31) datenum(2020,12,31)])
set(ax,'ylim',[-4 7])
ax.XAxis.FontSize = TickFontSize;
ax.YAxis.FontSize = TickFontSize;
ylabel('Percent','Interpreter','Latex','FontSize',FontSize)
title('A. Nominal slope','Interpreter','Latex','FontSize',FontSize)
box on

subplot(1,2,2)
hold on
plot(datenums2, tips_slope_10_1, '-b', 'LineWidth', LineWidth)
plot(datenums2, tips_liqadj_slope_10_1, '-.r', 'LineWidth', LineWidth)
datetick x
ax = gca;
set(ax,'xlim',[datenum(1998,11,31) datenum(2020,12,31)])
set(ax,'ylim',[-4 7])
ax.XAxis.FontSize = TickFontSize;
ax.YAxis.FontSize = TickFontSize;
ylabel('Percent','Interpreter','Latex','FontSize',FontSize)
title('B. Real slope','Interpreter','Latex','FontSize',FontSize)
box on
legend({'Not liq. adj.','Liq. adj.'},'Location','NorthWest','Interpreter','Latex','FontSize',FontSize)
legend boxoff